class Solution:
    def minWindow(self, s: str, t: str) -> str:
        res = ""
        counter = {}
        for string in t:
            if string in counter:
                counter[string] += 1
            else:
                counter[string] = 1
        count = len(counter.keys())
        left = 0
        right = 0
        while right < len(s):
            if s[right] in counter:
                counter[s[right]] -= 1
                if counter[s[right]] == 0:
                    count -= 1
            while count == 0:
                if s[left] in counter:
                    counter[s[left]] += 1
                    if counter[s[left]] == 1:
                        count += 1
                        if len(res) == 0 or right - left + 1 < len(res):
                            res = s[left:right + 1]
                left += 1
            right += 1

        return res
